package com.jia.springcloud.service;

import com.jia.springcloud.entities.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 1038940655
 * @create 2021/1/21 18:52
 */

@Service
//因为OpenFeign是面向接口的所以要在接口这里注解开启这个功能
@FeignClient(value = "SPRINGCLOUD-PROVIDER-PAYMENT")
public interface PaymentFeignService {

    @GetMapping("/payment/get/{id}")
    public abstract CommonResult getPaymentById(@PathVariable("id") Integer id);

    @RequestMapping("/payment/feign/timeout")
    public abstract String paymentFeignTimeout();
}
